function validateForm(form)
{	
	if(!sl_check(form.title,"标题",100,1)) return false; 	
	if(!sl_checkHTML(form.title,"标题")) return false;	
	
	var topicType = getRadioValue("topicType");	
	
	if(topicType=="2")
	{		
		if(!sl_checkInt(form.topicTypeNumMark,"积分",-1,1)) return false; 	
	}	
	else if(topicType=="3")
	{		
		if(!sl_checkInt(form.topicTypeNumMoney,"金币",-1,0)) return false;		
	}	
	else if(topicType=="4")
	{
		if(!sl_checkInt(form.topicTypeNumMarkGive,"散分",-1,0)) return false;		
	}
	
	var oFCKeditor = FCKeditorAPI.GetInstance('content');

	var content = oFCKeditor.GetXHTML(true);
	if(content.isEmpty())
	{
		sl_alert("正文不能为空！");
		return false;
	}
	else 
	{
		if(!oFCKeditor.IsDirty())
		{
			sl_alert("正文未被修改！");
			return false;
		}
	}	
	return true;
}


function showTypeInfo(id)
{
	if (id=="1"){
		$("div1").style.display = "none";
		$("div2").style.display = "none";
		$("div3").style.display = "none";
		$("div4").style.display = "none";
	}
	if (id=="2"){
		$("div1").style.display = "";
		$("div2").style.display = "none";
		$("div3").style.display = "none";
		$("div4").style.display = "none";
	}
	if (id=="3"){
		$("div1").style.display = "none";
		$("div2").style.display = "";
		$("div3").style.display = "none";
		$("div4").style.display = "none";
	}
	if (id=="4"){
		$("div1").style.display = "none";
		$("div2").style.display = "none";
		$("div3").style.display = "";
		$("div4").style.display = "none";
	}
	if (id=="5"){
		$("div1").style.display = "none";
		$("div2").style.display = "none";
		$("div3").style.display = "none";
		$("div4").style.display = "";
	}
}

function writeContent(i)
{
	var txt;
	txt = document.theform.content.value;
	txt = txt.replace("[tcontent]","");
	txt = txt.replace("[/tcontent]","");	
	if(i=="1"||i=="4"){ //判断是否为普通或求助贴
		document.theform.content.value = txt;		
	}else{
		document.theform.content.value = "[tcontent]" + txt + "[/tcontent]";
	}
}
